<template>
  <div id="store">
    <el-row>
       <el-col :span="4" :offset="2">
         <el-card :body-style="{ padding: '10px' }" style="width: 1200px; margin-top: 25px;">
           <el-row>
            <el-col :span="2">
               <div class="block" style="margin-top: 10px; margin-left: 10px;"><el-avatar :size="100" :src="storeInfo.logo"></el-avatar></div>
             </el-col>
            <el-col :span="12">
              <el-row>
                 <el-col :span="20" :offset="2" style="margin-top: 20px;">
                  <el-row>
                     <el-col>
                       <span style="font-size:18px;">{{storeInfo.storeName}}</span>
                     </el-col>
                   </el-row>
                 <el-row>
                     <el-col style="margin-top: 5px;">
                      <el-rate style="width: 170px;" v-model="storeInfo.storeScore" disabled  ></el-rate>
                     </el-col>
                   </el-row>
                  <el-row>
                     <el-col style="margin-top: 5px;">
                       <span style="font-size:15px; color: grey;">商家公告: {{storeInfo.affiche}}</span>
                     </el-col>
                   </el-row>
                 </el-col>
               </el-row>
             </el-col>
            <el-col :span="3" style="margin-top: 10px;">
              <el-row>
                <el-col :span="20">
                  <div style=" color: grey;" >月销</div>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="24">
                  <div style=" font-size: 20px; margin-top: 30px;" >{{storeInfo.count}}单</div>
                </el-col>
              </el-row>

            </el-col>
            <el-col :span="3" style="margin-left: 5px; margin-top: 10px;">
              <el-row>
                <el-col :span="20">
               <div style="color: grey;">配送费</div>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="24">
                  <div style=" font-size: 20px; margin-top: 30px;" >{{storeInfo.dphPrice}}元</div>
                </el-col>
              </el-row>
            </el-col>

            <el-col :span="3" style="margin-left: 5px; margin-top: 10px;">
              <el-row>
                <el-col :span="20">
                  <div style="color: grey;">起送价</div>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="24">
                  <div style=" font-size: 20px; margin-top: 30px;" >{{storeInfo.initiatePrice}}元</div>
                </el-col>
              </el-row>

            </el-col>
           </el-row>

         </el-card>
       </el-col>
     </el-row>

      <el-row>
       <el-col :span="10" :offset="2">
         <el-card :body-style="{ padding: '10px' }" style="width: 820px; margin-top: 25px;">
           <el-menu :default-active="activeIndex" active-text-color=#f08300 class="el-menu-demo" mode="horizontal" @select="handleSelect">
             <el-menu-item index="1">点菜单</el-menu-item>
             <el-menu-item index="2">评价</el-menu-item>
             <el-menu-item index="3">商家简介</el-menu-item>
           </el-menu>
          </el-card>
        </el-col>
        <el-col :span="7" :offset="4">
          <el-card :body-style="{ padding: '10px' }"  style="width: 355px; height: 80px; margin-top: 25px;">
            <el-row>
              <el-col :span="2">
                 <i class="el-icon-phone" style="color: black; font-size: 23px;line-height: 50px; margin-left: 20px;"></i>
              </el-col>
              <el-col :span="7">
                <div  style="margin-left: 20px;line-height: 45px;">订餐电话:</div>
              </el-col>
              <el-col  :span="12">
                 <div style="margin-left: 20px;line-height: 45px;">{{storeInfo.orderPhone}}</div>
              </el-col>
            </el-row>
          </el-card>
        </el-col>
      </el-row>

      <el-row>
        <el-col :span="20" :offset="2" style="height: 100%; width: 1200px;">
            <router-view></router-view>
        </el-col>
      </el-row>

  </div>
</template>

<script>
  export default {
    name: 'U_store',
    data() {
      return {
        storeId: null,
        score:"5",
        activeIndex:"1",
        circleUrl:"https://shadow.elemecdn.com/app/element/hamburger.9cf7b091-55e9-11e9-a976-7f4d0b07eef6.png",
        storeInfo:{
        },
      }
    },
    methods:{
      handleSelect(key, keyPath) {
          if(key==1){
            console.log(this.storeId)
            this.$router.push("/u_foods?id=" + this.storeId)
          }
          if(key==2){
            this.$router.push("/u_comment?id=" + this.storeId)
          }
          if(key==3){
            this.$router.push("/storeInfo?id=" + this.storeId)
          }

      },
      initParams() {
        this.storeId = this.$route.query.id;
      },
      getStoreInfo() {
        this.$http.get("/storeInfo/Info", {
          params: {
            id: this.storeId
          }
        }).then(resp =>{

          if (resp.data.code == 200) {
            console.log(resp.data.data)
            this.storeInfo = resp.data.data;

          }else{
            alert(resp.data.message)
          }
        })
      }
    },
    created(){
      this.initParams();
      this.handleSelect(1);
      this.getStoreInfo();
    },
    mounted() {

    }
  }
</script>

<style>
#id{
  background-color: ;
}
</style>
